package homework_0318;


/**
 * @Author YuLiping
 * @Date 2024/3/19 9:33
 * @Description This is description of class
 * @Since version-1.0
 */
public  class Rectangle extends Graph {
    private double length = 0;  //长
    private double weight = 0;  //宽

    public Rectangle() {
        super.drawGraph();
    }

    public double getLength() {
        return length;
    }

    public void setLength(double length) {
        this.length = length;
    }

    public double getWeight() {
        return weight;
    }

    public void setWeight(double weight) {
        this.weight = weight;
    }

    /**
     * @Author YiLiping
     * @Date 2024/3/19 9:39
     * @Description 计算面积
     * @Param []
     * @Return void
     * @Since version-1.0
     */
     public void getArea(){
        double area=this.weight * this.length;
         System.out.println("此矩形的面积是："+area);
     }
}
